<?php 
namespace Home\Controller;

class DesignersController extends HomeController {
    public function index(){
    	$banner = M("Ad")->where(array('id'=>4))->find();
        $this->assign('banner',$banner);

        $this->display();
    }

    public function detail(){
    	$id = I('get.id');
        if ($id=='' || !is_numeric($id)) {
            $this->error('参数错误');
        }

        $map['id'] = $id;
        $map['show'] = 1;    
        $list = M('Designer')->where($map)->find();
        if (!$list) {
            $this->error('信息不存在');
        }else{

            $list['image'] = explode(",", $list['image']);            
            unset($map);
            $map['disID'] = $id;
            $map['cid']=2;
            $count = M('Feedback')->where($map)->count();
            $list['count'] = $count+20;
            $this->assign('list',$list);

            $banner = M("Ad")->where(array('id'=>4))->find();
        	$this->assign('banner',$banner);

            $this->display();
        }
    }
}